  <nav class="navbar navbar-inverse">
      <div class="container">
        <div class="navbar-header">
          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="navbar-brand" href="/">TradeTrends</a>
        </div>
        <div id="navbar" class="navbar-collapse collapse">
          <ul class="nav navbar-nav">
          <li class="dropdown">
              <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">公共区 <span class="caret"></span></a>
              <ul class="dropdown-menu">
                <li><a href="{% url 'dashboard' %}">全部任务</a></li>
                <li><a href="{% url 'products' %}">产品仓库</a></li>
                <li><a href="#">行业分析</a></li>
              </ul>
          </li>
              {% if request.user %}
            <li{% ifequal avtive_nav_menu 'ucenter' %} class="active"{% endifequal %}><a href="{% url 'ucenter' %}">我的主页</a></li>
            <li{% ifequal avtive_nav_menu 'favorite' %} class="active"{% endifequal %}><a href="{% url 'favorite' %}">我的产品</a></li>
            <li{% ifequal avtive_nav_menu 'monitor' %} class="active"{% endifequal %}><a href="{% url 'monitor_products' %}">竞品监控</a></li>
            <li class="dropdown">
              <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">物流优化 <span class="caret"></span></a>
              <ul class="dropdown-menu">
                <li><a href="{% url 'logistics' %}">物流监控</a></li>
                <li><a href="{% url 'logistics_list' %}">全部物流</a></li>
                <li role="separator" class="divider"></li>
                <li><a href="{% url 'logistics_collect' %}"><i class="glyphicon glyphicon-info-sign"></i>采集物流</a></li>
                <li><a href="{% url 'logistics_settings' %}"><i class="glyphicon glyphicon-cog"></i>调控设置</a></li>
              </ul>
            </li>
              {% endif %}
          </ul>
            <ul class="nav navbar-nav pull-right">
                            {% if request.user.username %}
                            <li class="dropdown">
                                <a href="#" role="button" class="dropdown-toggle" data-toggle="dropdown"> <i class="glyphicon glyphicon-user"></i>
                                    {{ request.user.username }}<span class="caret"></span>
                                </a>
                                <ul class="dropdown-menu">
                                    <li><a href="{% url 'ucenter' %}">个人中心</a></li>
                                    <li><a href="{% url 'message' %}">我的消息</a></li>
                                    <li><a href="{% url 'profile' %}">帐户设置</a></li>
                                    <li role="separator" class="divider"></li>
                                    <li><a href="{% url 'favorite' %}">我的产品</a></li>
                                    <li><a href="{% url 'mytask' %}">我的任务</a></li>
                                    <li role="separator" class="divider"></li>
                                    <li><a href="{% url 'signout' %}"> <i class="glyphicon glyphicon-off"></i> 注销</a></li>

                                </ul>
                            </li>
                            {% else %}
                                <li class="dropdown">
                                    <a href="{% url "signin" %}">请登录</a>
                                </li>
                                {% endif %}
                        </ul>
        </div><!--/.nav-collapse -->
      </div>
    </nav>
